﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using syc.js.autocomplete;

namespace syc.js.autocomplete
{
    public partial class m : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(GetValues());
        }

        protected string GetValues() {
            string q = Request.QueryString["q"];
            string result=string.Empty;
            if (q != null)
            {
                using (testDataContext db = new testDataContext())
                {
                    List<string> temp = new List<string>();
                    temp = (from p in db.备品备件
                            select p.品名+p.规格).ToList();
                    foreach (string t in temp)
                    {
                        result += t + "\n";
                    }
                }
            }
            return result;
        }
    }
}
